package com.sgb.kjwl.view.widget;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.sgb.kjwl.R;
import com.swgk.core.dialog.BasePopWindow;
import com.swgk.core.dialog.PopViewHolder;


public class SexPopWindow extends BasePopWindow {

    private TextView tvMan;
    private TextView tvWomen;
    private TextView tCancel;

    public static final int SELECTE_MAN = 0;
    public static final int SELECTE_WOMEN = 1;

    public SexPopWindow(Context context) {
        super(context, DIR_DOWN_UP);
    }

    @Override
    protected int popLayout() {
        return R.layout.popwindow_sex;
    }

    @Override
    protected void initView(PopViewHolder holder) {
        tvMan = holder.getPop().findViewById(R.id.tv_man);
        tvWomen = holder.getPop().findViewById(R.id.tv_women);
        tCancel = holder.getPop().findViewById(R.id.tv_cancel);

        tvMan.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                onResultClick.result(SELECTE_MAN, SELECTE_MAN,null);
                dismiss();
            }
        });

        tvWomen.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                onResultClick.result(SELECTE_WOMEN,SELECTE_WOMEN,null);
                dismiss();
            }
        });

        tCancel.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
            }
        });

    }

}
